﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="Callin_Log.aspx.cs"
    Inherits="Callin_Log" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>来话宝
        <%=FTchina.Library.MasterHelper.ClientTitle %>-来 电 历 史 记 录 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="/images/style.css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/jiazai.js"></script>
    <script src="/js/introbox.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/pagefunction.js"></script>
    <script type="text/javascript" type="text/javascript">


        $(function () {
            $("#checkall").click(

        function () {

            if (this.checked) {
                $("input[name='ids']").each(function () { this.checked = true; });
            } else {
                $("input[name='ids']").each(function () { this.checked = false; });
            }
        });
        });
        function jqchk(op) {  //jquery获取复选框值


            var chk_value = [];
            $('input[name="ids"]:checked').each(function () {
                chk_value.push($(this).val());


            });

            if (chk_value.length > 0) {
                var url;

                url = 'pcallin_log.aspx?ids=' + chk_value + '&op=del&type=callinlog&back=callin_log.aspx';

                window.location.href = url;
            }
            else {
                alert("请至少选择一项");
            }
        }   
    </script>
</head>
<body style="overflow-x: hidden">
    <form id="form1" runat="server">
    <div>
        <table width="100%" class="tableBorder" border='1' cellspacing="0" style="border-collapse: collapse;"
            bgcolor="#ffffff" bordercolor="#cccccc">
            <tr align="center" valign="middle">
                <th height="22" colspan="88">
                    来 电 历 史 记 录
                </th>
            </tr>
            <tr>
                <td>
                    操作
                </td>
                <td>
                    <input type="button" class="btn" value="刷新" onclick="Refresh()" />
                    <asp:Button runat="server" ID="btnexcel" Text="导出Excel" OnClick="btnexcel_Click"
                        CssClass="btn" />
                    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;
                    <input type='checkbox' id='checkall' name='checkall' />全选/取消
                    <input class="btn" type="button" onclick="{if(confirm('请确认操作?')){jqchk('sms');}return false;}"
                        value="删除" />
                    <asp:Button runat="server" ID="Button1" Text="删除一周前记录" OnClick="btndelweek_Click" CssClass="btn" />
                    <asp:Button runat="server" ID="Button2" Text="删除一月前记录" OnClick="btndelmonth_Click" CssClass="btn" />
                </td>
            </tr>
        </table>
        <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:GridView ID="gvList" runat="server" AllowPaging="false" CellPadding="2" AutoGenerateColumns="False"
                        GridLines="Both" EmptyDataText="当前页无数据" CssClass="tableBorder" Width="100%">
                        <Columns>
                            <asp:TemplateField HeaderText="序号">
                                <ItemTemplate>
                                    <input type='checkbox' id='ids' name='ids' value='<%# Eval("Id") %>' /><%# Eval("Id") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="callnum" HeaderText="来电号码" />
                            <asp:TemplateField HeaderText="来电速录">
                                <ItemTemplate>
                                    <a style="color: Green; font-weight: bolder" title='header=[说明] body=[点击可打开来电预定界面<br>]'
                                        href="callin.aspx?phone=<%# Eval("callnum") %>">点击进入</a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="接听状态">
                                <ItemTemplate>
                                    <%# (Eval("state").ToString() == "0") ? "未接听" : "已接听"%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="录入状态">
                                <ItemTemplate>
                                    <%# (FTchina.SMS.CustomerInfo.CheckCustomer(Eval("callnum").ToString())) ? "已录入" : "<span style=' color=orange; color=orange;font-weight:bold' >未录入</span>"%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="客户信息">
                                <ItemTemplate>
                                    <%# FTchina.SMS.CustomerInfo.GetCusetomerInfoByPhone(Eval("callnum").ToString())%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="calltime" HeaderText="来电时间" />
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <input class="btn" type="button" onclick="javascript:if (confirm('您真的确定要删除吗？\n\n请确认！')==true){Go('?act=del&id=<%#Eval("id")%>')}else{return false}"
                                        value="删除" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Visible="False" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <asp:Literal runat="server" ID="litpager"></asp:Literal>
    </div>
    </form>
    <script language='javascript' type='text/javascript' src='/JS/tablecolor.js'></script>
    <script type='text/javascript' language='javascript'><!--
        TableColor('gvList', '#F1F8FE', '#FFFFFF', '#F8DC87', '#BCE774');
    --></script>
</body>
</html>
